import base64

import json
import time

str = "Bear eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiZXhwIjoxNTUwNTY0MDMxLjE0ODM1NzJ9.6ZKfsA7H8vMOsiK3aq51bVpDPp1dUW1yLomOoX-91fg"
payload = str.split(".")[1]

payload_json_encode = base64.decodebytes(payload.encode())
payload_josn = payload_json_encode.decode()

payload_obj = json.loads(payload_josn)
exp_second = payload_obj["exp"]
current_seconds = time.time()
if exp_second - current_seconds < 600:
    print("has exp")